package com.yunhe.device.service.base;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.device.domain.base.PointDataType;
import com.yunhe.device.model.base.AnlogTypeQueryCondition;
import com.yunhe.device.model.base.AnlogTypeVo;
import com.yunhe.device.model.base.StatusVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName AanlogTypeService
 * @Description TODO
 * @Author HeTao
 * @Date 2021/7/13 17:44
 * @Version 1.0
 **/
public interface AnlogTypeService {
    /**
     * 新增点号类型
     * @param anlogType
     * @return
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    PointDataType createAnlogType(PointDataType anlogType) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 查询点号类型列表
     * @param anlogTypeQueryCondition
     * @return
     */
    Iterable<AnlogTypeVo> getAnlogTypeByCondition(AnlogTypeQueryCondition anlogTypeQueryCondition);

    /**
     * 查询点号类型详情
     * @param id
     * @return
     */
    AnlogTypeVo getAnlogTypeById(Long id) throws ObjectNotFoundException;

    /**
     * 根据id 删除点号类型
     * @param id
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void deleteAnlogTypeById(Long id) throws ArgumentErrorException, ObjectNotFoundException;

    /**
     * 修改点号类型
     * @param anlogType
     * @return
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    PointDataType updateAnlogType(PointDataType anlogType) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 点号类型禁用恢复
     *
     * @param statusVo@return
     */
    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void updateAnlogTypeStatus(StatusVo statusVo) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    /**
     * 根据设备类型查询点号类型列表
     * @param equipName
     * @return
     */
    Iterable<PointDataType> getAnlogTypeByEquipTypeName(String equipName);

    /**
     * 根据设备类型分页查询点号类型信息
     * @param id
     * @param page
     * @param size
     * @return
     */
    Iterable<AnlogTypeVo> getAnlogTypeByEquipTypeId(Long id, int page, int size);

    List<AnlogTypeVo> getAnlogTypeByEquipTypeId(Long id);
}
